<div class="modal-header primary">
    <h5 class="modal-title" id="modal-title">
        Configure <span class="capitalize">
            {{integration.name.toUpperCase()}}
        </span>
        <a  class="modal-close pull-right" ng-click="close()">
            <i class="mdi mdi-close"></i>
        </a>

    </h5>
</div>
<div class="modal-body">
    <form name="integrationForm" ng-submit="submit()">
        <div class="form-group" ng-class="{'has-error' : errors[key]}" data-ng-repeat="item in integration.config.fields">
            <label>{{item.name}} <span class="text-danger" data-ng-if="item.required">*</span></label>
            <div ng-switch on="item.type">
                <div ng-switch-when="text">
                    <input type="text"
                           required="{{item.required}}"
                           placeholder="{{item.name}}"
                           ng-model="item.value"
                           class="form-control">
                </div>
            </div>
        </div>
        <div class="form-group">
            <button type="submit" data-ng-disabled="busy" class="btn btn-primary btn-block">
                <i class="mdi mdi-check" ng-if="!busy"></i>
                <fading-circle-spinner class="spinner spinner-invert pull-left" ng-if="busy"></fading-circle-spinner>
                submit changes
            </button>
        </div>
    </form>
</div>